<nz-row>
  <div class="searchItem">
    <label for="name">题目名称</label>
    <input
      id="name"
      nz-input
      placeholder="请输入题目名称"
      [(ngModel)]="query.name"
    />
  </div>
  <div class="searchItem">
    <label for="date">更新时间</label>
    <nz-range-picker id="date" nzFormat="yyyy-MM-dd" [(ngModel)]="query.date"></nz-range-picker>
  </div>
  <div class="searchItem">
    <button nz-button nzType="primary" (click)="queryBtn()">查询</button>
    <button nz-button nzType="default" (click)="resetQuery()">重置</button>
  </div>
</nz-row>
<!--操作-->
<nz-row>
  <button nz-button nzType="primary" (click)="add()">添加</button>
</nz-row>
<!--表格-->
<nz-table
  style="margin-top: 8px"
  #rowSelectionTable
  nzSize="small"
  nzTableLayout="fixed"
  nzShowSizeChanger
  nzShowQuickJumper
  nzOuterBordered
  [nzData]="listOfData.records"
  [nzPageSizeOptions]="[5, 10, 20, 50, 100]"
  [nzTotal]="listOfData.total"
  [(nzPageIndex)]="query.page"
  [(nzPageSize)]="query.pageSize"
  [nzFrontPagination]="false"
  [nzShowTotal]="totalTemplate"
  (nzPageIndexChange)="onPageIndexChange($event)"
  (nzPageSizeChange)="onPageSizeChange($event)"
>
  <thead>
  <tr>
    <th nzAlign="center">题目id</th>
    <th nzAlign="center" style="white-space: pre">前端名称</th>
    <th nzAlign="center" style="white-space: pre">内部名称</th>
    <th nzAlign="center">选项</th>
    <th nzAlign="center">更新时间</th>
    <th nzAlign="center" nzWidth="250px">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of rowSelectionTable.data;let index=index;">
    <td nzAlign="center">{{ data['id'] }}</td>
    <td nzAlign="center">{{ data['questionName'] }}</td>
    <td nzAlign="center">{{ data['internalName'] }}</td>
    <td nzAlign="center" nzEllipsis [nzTooltipTitle]="data['optionName']" nzTooltipPlacement="top" nz-tooltip>
      {{ data['optionName'] }}
    </td>
    <td nzAlign="center">{{ data['updateTime'] }}</td>
    <td nzAlign="center">
      <!--      <a (click)="view(data)">查看</a>-->
      <a (click)="edit(data['id'])">编辑</a>
      <a (click)="copy(data['id'])">复制</a>
      <a style="color: #F56C6C"
         nzPopconfirmPlacement="top"
         nz-popconfirm
         nzPopconfirmTitle="确认要删除该数据吗?"
         nzOkText="确认"
         nzCancelText="取消"
         (nzOnConfirm)="deleteRow(data['id'])">删除</a>
    </td>
  </tr>
  </tbody>
</nz-table>
<!-- 分页template -->
<ng-template #totalTemplate let-total>共有 {{ listOfData.total }} 条</ng-template>
